import ch from "@/translations/zhCN";
// @ts-ignore
import en from "@/translations/en";
import i18next from 'i18next';

i18next.init({
    lng: 'ch',
    debug: false,
    resources: {
        ch: {
            translation: ch
        },
        en: {
            translation: en
        }
    }
}).then(r => {
    console.log("初始化完成")
});

export default function(text: any, params: any) {
    if (!text || typeof text !== "string") {
        return text;
    }

    return i18next.t(text, params)
}
